<%--
    Document   : index
    Created on : 2010-6-23, 19:06:39
    Author     : reyesyang
    JQuery     : jquery-1.4.2
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ page isELIgnored="false" %>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>


<html:html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Reyes Yang's Utopia</title>
        <script type="text/javascript" src="/resource/script/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="/resource/ckeditor/ckeditor.js"></script>
        <script type="text/javascript" src="/resource/script/blog.js"></script>
        <link rel="stylesheet" type="text/css" href="/resource/style/global.css"/>
        <link rel="stylesheet" type="text/css" href="/resource/style/newBlog.css"/>
    </head>
    <body>
        <div id="header">
            <jsp:include page="/page/global/header.jsp"/>
        </div>
        <div id="nav">
            <jsp:include page="/page/admin/global/navigation.jsp" />
        </div>
        <div id="content">
            <div id="main">
                <em id="page-title-without-margin">Edit Blog</em>
                <html:form method="post" action="/saveBlogEdit.do">
                    <html:hidden property="blogId" value="${blog.key.id}"/>
                    <p>
                        <label for="blogTitle">
                            Title:
                        </label>
                        <html:text property="blogTitle" size="50" value="${blog.title}"/>
                        <html:errors property="blogTitle"/>
                    </p>

                    <p>
                        <label for="blogCategory">
                            Category:
                        </label>
                        <html:select property="blogCategory" value="${blog.category}" onfocus="initCategory()">
                            <html:option value="not-chose">Please chose</html:option>
                        </html:select>
                        <a href="#" onclick="showCategoryManagementPanel()">Edit</a>
                        <html:errors property="blogCategory"/>
                    </p>

                    <p>
                        <label for="blogPrivacy">
                            Privacy:
                        </label>
                        <html:select property="blogPrivacy" value="${blog.privacy}">
                            <html:option value="not-chose">Please chose</html:option>
                            <html:option value="public">Public</html:option>
                            <html:option value="private">Private</html:option>
                        </html:select>
                        <html:errors property="blogPrivacy"/>
                    </p>

                    <p>
                        <label for="blogSummary">
                            Summary:
                        </label>
                        <html:textarea rows="5" cols="50" property="blogSummary" value="${blog.summary}">
                        </html:textarea>
                        <html:errors property="blogSummary"/>
                    </p>

                    <p>
                        <label for="blogContent" style="vertical-align: top">
                            Content:
                        </label>
                        <html:textarea rows="5" cols="50" property="blogContent" value="${blog.content}">
                        </html:textarea>
                        <script type="text/javascript">
                            CKEDITOR.replace('blogContent');
                        </script>
                    </p>

                    <p>
                        <html:submit value="Submit"/>
                    </p>
                </html:form>
            </div>
            <div id="categoryManagement">
                <table class="popup">
                    <tbody>
                        <tr>
                            <td class="popup_tl"></td>
                            <td class="popup_top"></td>
                            <td class="popup_tr"></td>
                        </tr>
                        <tr>
                            <td class="popup_left"></td>
                            <td class="center">
                                <div id="categoryMgPanel">
                                    <div id="closePanel" onclick="closePanel()" title="Close"></div>
                                    <div id="managementPanel">
                                        <h2>分类管理</h2>
                                        <div id="haveCreated">
                                        </div>
                                        <div id="createCategory">
                                            <input type="text" id="newCategory" size="15">
                                            <input type="button" value=""  title="Add" onclick="addNewCategory()">
                                            <em class="state"></em>
                                        </div>
                                    </div>
                                </div>
                            </td>
                            <td class="popup_right"></td>
                        </tr>
                        <tr>
                            <td class="popup_bl"></td>
                            <td class="popup_buttom"></td>
                            <td class="popup_br"></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div id="footer"></div>
    </body>
</html:html>
